home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / SASC_6.0_Disk_4.adf / Compiler_Headers / Include / libraries / asl.h next >
C/C++ Source or Header  |  1992-07-30  |  8KB  |  231 lines

  1. #ifndef    LIBRARIES_ASL_H
  2. #define    LIBRARIES_ASL_H    1
  3.  
  4. /*
  5. **    $Filename: libraries/asl.h $
  6. **    $Release: 2.04 Includes, V37.4 $
  7. **    $Revision: 36.5 $
  8. **    $Date: 91/11/08 $
  9. **
  10. **    ASL library name and useful definitions.
  11. **
  12. **    (C) Copyright 1989,1990 Charlie Heath
  13. **    (C) Copyright 1989-1991 Commodore-Amiga, Inc.
  14. **        All Rights Reserved
  15. */
  16.  
  17. #ifndef    EXEC_TYPES_H
  18. #include    <exec/types.h>
  19. #endif
  20.  
  21. #ifndef    EXEC_LISTS_H
  22. #include    <exec/lists.h>
  23. #endif
  24.  
  25. #ifndef    EXEC_LIBRARIES_H
  26. #include    <exec/libraries.h>
  27. #endif
  28.  
  29. #ifndef UTILITY_HOOKS_H
  30. #include <utility/hooks.h>
  31. #endif
  32.  
  33. #ifndef UTILITY_TAGITEM_H
  34. #include <utility/tagitem.h>
  35. #endif
  36.  
  37. #ifndef WBArg
  38. #include <workbench/startup.h>
  39. #endif
  40.  
  41. #ifndef GRAPHICS_TEXT_H
  42. #include <graphics/text.h>
  43. #endif
  44.  
  45. /*
  46.  ************************************************************************
  47.  *    Standard definitions for asl library information        *
  48.  ************************************************************************
  49.  */
  50.  
  51. #define    AslName        "asl.library"
  52.  
  53. /*
  54.  ************************************************************************
  55.  *                                    *
  56.  *    The ASL file requester data structure...            *
  57.  *                                    *
  58.  * The fields described here are for READ ACCESS to the structure    *
  59.  * returned by AllocAslRequest( ASL_FileRequest, ... )            *
  60.  *                                    *
  61.  * Any modifications MUST be done via TAGS either at the time of    *
  62.  * creation by AllocAslRequest(), or when used, via AslRequest()    *
  63.  *                                    *
  64.  ************************************************************************
  65.  */
  66. struct FileRequester    {
  67.     APTR    rf_Reserved1;
  68.     BYTE    *rf_File;    /* Filename pointer        */
  69.     BYTE    *rf_Dir;    /* Directory name pointer    */
  70.     CPTR    rf_Reserved2;
  71.     UBYTE    rf_Reserved3;
  72.     UBYTE    rf_Reserved4;
  73.     APTR    rf_Reserved5;
  74.     WORD    rf_LeftEdge,rf_TopEdge;    /* Preferred window pos    */
  75.     WORD    rf_Width,rf_Height;   /* Preferred window size    */
  76.     WORD    rf_Reserved6;
  77.     LONG    rf_NumArgs;    /* A-la WB Args, for multiselects */
  78.     struct WBArg *rf_ArgList;
  79.     APTR    rf_UserData;    /* Applihandle (you may write!!) */
  80.     APTR    rf_Reserved7;
  81.     APTR    rf_Reserved8;
  82.     BYTE    *rf_Pat;    /* Pattern match pointer */
  83.     };            /* note - more reserved fields follow */
  84.  
  85.  
  86. /*
  87.  * The following defined values are the ASL_FuncFlags tag values which
  88.  * are defined for the ASL file request.  These values may be passed
  89.  * as a TagItem to modify the way the requester is presented.  Each
  90.  * flag value defined has a description of the particular action.
  91.  *
  92.  * Also related to the ASL_FuncFlags values is the ASL_HookFunc tagitem,
  93.  * which provides a callback function pointer to allow the application
  94.  * to interact with the requester.  If an ASL_HookFunc TagItem is
  95.  * provided, the hook function will be called like so:
  96.  *
  97.  * ULONG rf_Function(ULONG Mask, CPTR Object, CPTR AslRequester)
  98.  *
  99.  * The Mask value is a copy of the specific ASL_FuncFlags value
  100.  * the callback is for; Object is a pointer to a data object.
  101.  * AslRequester is a pointer to the requester structure.
  102.  *
  103.  * For the ASL file and font requesters, two ASL_FuncFlags values
  104.  * are currently defined; FILF_DOWILDFUNC and FILF_DOMSGFUNC.
  105.  *
  106.  */
  107.  
  108. #define    FILB_DOWILDFUNC    7L /* Called with an Object=AnchorPath,    */
  109.                /*         ZERO return accepts.    */
  110. #define    FILB_DOMSGFUNC    6L /* Called with Object=IDCMP message    */
  111.                /*  for other window of shared port. */
  112.                /* You must return pointer to Object,*/
  113.                /* asl will reply the Object for you */
  114. #define    FILB_SAVE    5L /* For a SAVE operation, set this bit */
  115. #define    FILB_NEWIDCMP    4L /* Force a new IDCMP (only if rf_Window != NULL)  */
  116. #define FILB_MULTISELECT 3L /* Request multiple selections returned from FR. */
  117.                /*    MULISELECT is ignored if FILB_SAVE is on     */
  118. #define    FILB_PATGAD    0L /* Ask for pattern gadget                 */
  119.  
  120.  
  121. #define    FILF_DOWILDFUNC    (1L << FILB_DOWILDFUNC)
  122. #define    FILF_DOMSGFUNC    (1L << FILB_DOMSGFUNC)
  123.  
  124. #define    FILF_SAVE    (1L << FILB_SAVE)
  125. #define    FILF_NEWIDCMP    (1L << FILB_NEWIDCMP)
  126. #define    FILF_MULTISELECT (1L << FILB_MULTISELECT)
  127. #define    FILF_PATGAD    (1L << FILB_PATGAD)
  128.  
  129.  
  130. /* The following additional flags may be passed with the
  131.  * ASL_ExtFlags1 tag.
  132.  */
  133. #define    FIL1B_NOFILES    0L /* Do not want a file gadget, no files shown      */
  134. #define    FIL1B_MATCHDIRS    1L /* Have Patgad or rf_Pat screen files AND DIRS    */
  135.  
  136. #define    FIL1F_NOFILES    (1L << FIL1B_NOFILES)
  137. #define    FIL1F_MATCHDIRS    (1L << FIL1B_MATCHDIRS)
  138.  
  139.  
  140. /*
  141.  ************************************************************************
  142.  *    The ASL font requester data structure...            *
  143.  *                                    *
  144.  * As with the FileRequest structure, the fields documented here are    *
  145.  * for READ ACCESS ONLY.  Any modifications must be done via tags.    *
  146.  ************************************************************************
  147.  */
  148. struct FontRequester    {
  149.     APTR    fo_Reserved1[2];
  150.     struct TextAttr fo_Attr;    /* Returned TextAttr        */
  151.     UBYTE    fo_FrontPen;        /* Returned pens, if selected    */
  152.     UBYTE    fo_BackPen;
  153.     UBYTE    fo_DrawMode;
  154.     APTR    fo_UserData;
  155.     };
  156.  
  157. /* Bit defines for ASL_FuncFlags, for FONT requester            */
  158. /* See descriptive text for FILF_ values above for an overview.        */
  159. /* Note - old mixed-case defines were nonstandard, now obsolete        */
  160.  
  161. #define    FONB_FRONTCOLOR    0    /* Display Front color selector?    */
  162. #define    FONB_BACKCOLOR    1    /* Display Back color selector?        */
  163. #define    FONB_STYLES    2    /* Display Styles checkboxes?        */
  164. #define    FONB_DRAWMODE    3    /* Display DrawMode NWay?        */
  165. #define    FONB_FIXEDWIDTH    4    /* Only allow fixed-width fonts?    */
  166. #define    FONB_NEWIDCMP    5    /* Create a new IDCMP port, not shared    */
  167. #define    FONB_DOMSGFUNC    6    /* Called with Object=IntuiMessage for    */
  168.                 /*    other windows in shared port,    */
  169.                 /*   you must return Object pointer    */
  170.                 /*   and asl will reply Object for you    */
  171. #define    FONB_DOWILDFUNC    7    /* Called with Object=TextAttr to approve*/
  172.                 /*    NON-Zero return accepts        */
  173.  
  174. #define    FONF_FRONTCOLOR    (1L << FONB_FRONTCOLOR)
  175. #define    FONF_BACKCOLOR    (1L << FONB_BACKCOLOR)
  176. #define    FONF_STYLES    (1L << FONB_STYLES)
  177. #define    FONF_DRAWMODE    (1L << FONB_DRAWMODE)
  178. #define    FONF_FIXEDWIDTH    (1L << FONB_FIXEDWIDTH)
  179. #define    FONF_NEWIDCMP    (1L << FONB_NEWIDCMP)
  180. #define    FONF_DOMSGFUNC    (1L << FONB_DOMSGFUNC)
  181. #define    FONF_DOWILDFUNC    (1L << FONB_DOWILDFUNC)
  182.  
  183.  
  184. /************************************************************************/
  185. /* Arguments to AllocAslRequest()                    */
  186. /* Types of requester structures which may be allocated:        */
  187. /************************************************************************/
  188. #define    ASL_FileRequest    0
  189. #define    ASL_FontRequest    1
  190.  
  191. /************************************************************************/
  192. /* Tags for AllocAslRequest() and AslRequest()                */
  193. /************************************************************************/
  194.  
  195. #define ASL_Dummy (TAG_USER + 0x80000)
  196.  
  197. #define ASL_Hail    ASL_Dummy+1    /* Hailing text follows             */
  198. #define ASL_Window    ASL_Dummy+2    /* Parent window for IDCMP & screen  */
  199. #define    ASL_LeftEdge    ASL_Dummy+3    /* Initialize LeftEdge             */
  200. #define    ASL_TopEdge    ASL_Dummy+4    /* Initialize TopEdge             */
  201. #define    ASL_Width    ASL_Dummy+5
  202. #define    ASL_Height    ASL_Dummy+6
  203. #define    ASL_HookFunc    ASL_Dummy+7    /* Hook function pointer         */
  204.  
  205. /* Tags specific to file request                         */
  206. #define    ASL_File    ASL_Dummy+8    /* Initial name of file follows         */
  207. #define    ASL_Dir        ASL_Dummy+9    /* Initial string of filerequest dir */
  208.  
  209. /* Tags specific to font request                         */
  210. #define    ASL_FontName    ASL_Dummy+10    /* Initial font name             */
  211. #define    ASL_FontHeight    ASL_Dummy+11    /* Initial font height             */
  212. #define    ASL_FontStyles    ASL_Dummy+12    /* Initial font styles             */
  213. #define    ASL_FontFlags    ASL_Dummy+13    /* Initial font flags for textattr   */
  214. #define    ASL_FrontPen    ASL_Dummy+14    /* Initial frontpen color         */
  215. #define    ASL_BackPen    ASL_Dummy+15    /* Initial backpen color         */
  216. #define    ASL_MinHeight    ASL_Dummy+16    /* Minimum font height to display    */
  217. #define    ASL_MaxHeight    ASL_Dummy+17    /* Max font height to display         */
  218.  
  219. #define    ASL_OKText    ASL_Dummy+18    /* Text displayed in OK gadget         */
  220. #define    ASL_CancelText    ASL_Dummy+19    /* Text displayed in CANCEL gadget   */
  221. #define    ASL_FuncFlags    ASL_Dummy+20    /* Function flags, depend on request */
  222.  
  223. #define    ASL_ModeList    ASL_Dummy+21    /* Substitute list for font drawmodes */
  224. #define    ASL_ExtFlags1    ASL_Dummy+22    /* For passing extended FIL1F flags   */
  225.  
  226. #define    ASL_Pattern    ASL_FontName    /* File requester pattern string     */
  227.  
  228. /******** END of ASL Tag values    *****************************************/
  229.  
  230. #endif
  231.